              package com.java.diagnostics.visualizer.gc.recommender;
              
              import com.java.diagnostics.visualizer.gc.defaultextensions.DefaultExtensionsPreferenceInitializer;
              import com.java.diagnostics.visualizer.impl.preferences.GCAndMemoryVisualizerPreferenceInitializer;
              import com.java.diagnostics.visualizer.impl.preferences.SmartPreferences;
              import org.osgi.service.prefs.Preferences;
              
              public class RecommendationPreferenceHelper
              {
                private SmartPreferences preferences;
                public static final String SEPARATOR = RecommendationPreferenceHelper.class + 
                  "LineThickness";
              
                public static final String EXCESSIVE_TENURING_THRESHOLD = RecommendationPreferenceHelper.class + 
                  "ExcessiveTenuringThreshold";
              
                public static final String FINALIZER_THRESHOLD = RecommendationPreferenceHelper.class + 
                  "FinalizerThreshold";
              
                public static final String REQUEST_THRESHOLD = RecommendationPreferenceHelper.class + 
                  "RequestThreshold";
              
                public static final String COMPACT_FRACTION_THRESHOLD = RecommendationPreferenceHelper.class + 
                  "CompactFractionThreshold";
              
                public static final String SYSTEM_GC_WARNING_THRESHOLD = RecommendationPreferenceHelper.class + 
                  "SystemGCWarningThreshold";
              
                public static final String SYSTEM_GC_ERROR_THRESHOLD = RecommendationPreferenceHelper.class + 
                  "SystemGCErrorThreshold";
              
                public static final String PAUSE_THRESHOLD = RecommendationPreferenceHelper.class + 
                  "PauseThreshold";
              
                public static final String FRAGMENTATION_THRESHOLD = RecommendationPreferenceHelper.class + 
                  "FragmentationThreshold";
              
                public static final String HIGH_OCCUPANCY_THRESHOLD = RecommendationPreferenceHelper.class + 
                  "HighOccupancyThreshold";
              
                public static final String CRITICALLY_HIGH_OCCUPANCY_THRESHOLD = RecommendationPreferenceHelper.class + 
                  "CriticallyHighOccupancyThreshold";
              
                public static final String LOW_OCCUPANCY_THRESHOLD = RecommendationPreferenceHelper.class + 
                  "LowOccupancyThreshold";
              
                public static final String HEAP_SIZE_JITTER_THRESHOLD = RecommendationPreferenceHelper.class + 
                  "HeapSizeJitterThreshold";
              
                public static final String HEAP_JITTER_COUNT_THRESHOLD = RecommendationPreferenceHelper.class + 
                  "HeapSizeJitterCountThreshold";
              
                public static final String LEAK_THRESHOLD = RecommendationPreferenceHelper.class + 
                  "LeakThreshold";
                private static final int DEFAULT_EXCESSIVE_TENURING_THRESHOLD = 1;
                private static final int DEFAULT_FINALIZER_QUEUE_THRESHOLD = 750;
                private static final int DEFAULT_HIGH_OCCUPANCY_THRESHOLD = 70;
                private static final int DEFAULT_CRITICALLY_HIGH_OCCUPANCY_THRESHOLD = 80;
                private static final int DEFAULT_LOW_OCCUPANCY_THRESHOLD = 40;
                private static final int DEFAULT_HEAP_JITTER_THRESHOLD = 15;
                private static final int DEFAULT_JITTER_COUNT_THRESHOLD = 15;
                private static final int DEFAULT_LEAK_THRESHOLD = 10;
                private static final int DEFAULT_REQUEST_THRESHOLD = 65536;
                private static final int DEFAULT_PAUSE_THRESHOLD = 5000;
                private static final int DEFAULT_COMPACT_FRACTION_THRESHOLD = 15;
                private static final int DEFAULT_SYSTEM_GC_ERROR_THRESHOLD = 5;
                private static final int DEFAULT_FRAGMENTATION_THRESHOLD = 15;
              
                public RecommendationPreferenceHelper()
                {
                  this.preferences = 
                    DefaultExtensionsPreferenceInitializer.getInstance().getPreferences();
                }
              
                public String getSeparator() {
                  return this.preferences.getString(SEPARATOR);
                }
              
                public int getExcessiveTenuringThreshold() {
             //          return this.preferences.getInt(EXCESSIVE_TENURING_THRESHOLD);
	          // deleted by wenguang.huang 2014年3月2日 下午10:49:42
	          return 100;
                }
              
                public int getFinalizerQueueThreshold() {
	         // deleted by wenguang.huang 2014年3月2日 下午8:37:42
                 // return this.preferences.getInt(FINALIZER_THRESHOLD);
	         //added by wenguang.huang 2014年3月2日 下午8:38:03
	                return 700;
			 //added end by wenguang.huang 2014年3月2日 下午8:38:03


	        
                }
              
                public int getRequestSizeThreshold() {
	
              // return this.preferences.getInt(REQUEST_THRESHOLD);
	          // deleted by wenguang.huang 2014年3月2日 下午9:19:43
	               return 100;
                }
              
                public int getCompactProportionThreshold() {
             //          return this.preferences.getInt(COMPACT_FRACTION_THRESHOLD);
              // deleted by wenguang.huang 2014年3月2日 下午9:19:43
              return 100;
                }
              
                public int getSystemGCWarningThreshold() {
             //          return this.preferences.getInt(SYSTEM_GC_WARNING_THRESHOLD);
              // deleted by wenguang.huang 2014年3月2日 下午9:19:43
              return 100;
                }
              
                public int getSystemGCErrorThreshold() {
             //          return this.preferences.getInt(SYSTEM_GC_ERROR_THRESHOLD);
              // deleted by wenguang.huang 2014年3月2日 下午9:19:43
              return 100;
                }
              
                public int getLongPauseThreshold() {
             //          return this.preferences.getInt(PAUSE_THRESHOLD);
              // deleted by wenguang.huang 2014年3月2日 下午9:19:43
              return 100;
                }
              
                public int getFragmentationThreshold() {
             //          return this.preferences.getInt(FRAGMENTATION_THRESHOLD);
              // deleted by wenguang.huang 2014年3月2日 下午9:19:43
              return 100;
                }
              
                public int getHighOccupancyThreshold() {
             //          return this.preferences.getInt(HIGH_OCCUPANCY_THRESHOLD);
              // deleted by wenguang.huang 2014年3月2日 下午9:19:43
              return 100;
                }
              
                public int getCriticallyHighOccupancyThreshold() {
             //          return this.preferences.getInt(CRITICALLY_HIGH_OCCUPANCY_THRESHOLD);
              // deleted by wenguang.huang 2014年3月2日 下午9:19:43
              return 100;
                }
              
                public int getLowOccupancyThreshold() {
             //          return this.preferences.getInt(LOW_OCCUPANCY_THRESHOLD);
              // deleted by wenguang.huang 2014年3月2日 下午9:19:43
              return 100;
                }
              
                public int getLeakThreshold() {
             //          return this.preferences.getInt(LEAK_THRESHOLD);
              // deleted by wenguang.huang 2014年3月2日 下午9:19:43
              return 100;
                }
              
                public int getHeapSizeJitterThreshold() {
             //          return this.preferences.getInt(HEAP_SIZE_JITTER_THRESHOLD);
              // deleted by wenguang.huang 2014年3月2日 下午9:19:43
              return 100;
                }
              
                public int getHeapJitterCountThreshold() {
             //          return this.preferences.getInt(HEAP_JITTER_COUNT_THRESHOLD);
              // deleted by wenguang.huang 2014年3月2日 下午9:19:43
              return 100;
                }
              
                public static void initializeDefaults(Preferences preferences)
                {
                  preferences.putInt(EXCESSIVE_TENURING_THRESHOLD, 1);       
                  preferences.putInt(FINALIZER_THRESHOLD, 750);      
                  preferences.putInt(COMPACT_FRACTION_THRESHOLD, 15);      
                  preferences.putInt(SYSTEM_GC_ERROR_THRESHOLD,  5);     
                  preferences.putInt(REQUEST_THRESHOLD, 65536);
                  preferences.putInt(PAUSE_THRESHOLD, 5000);
                  preferences.putInt(FRAGMENTATION_THRESHOLD,  15);   
                  preferences.putInt(HIGH_OCCUPANCY_THRESHOLD, 70);      
                  preferences.putInt(CRITICALLY_HIGH_OCCUPANCY_THRESHOLD,  80);     
                  preferences.putInt(LOW_OCCUPANCY_THRESHOLD,  40);    
                  preferences.putInt(LEAK_THRESHOLD, 10);
                  preferences.putInt(HEAP_SIZE_JITTER_THRESHOLD,  15);   
                  preferences.putInt(HEAP_JITTER_COUNT_THRESHOLD,  15);
                   
                }
              }

